package org.Vancl.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.Vancl.Dao.ShoppingAddressDao;
import org.Vancl.Dao.ImpI.ShoppingAddressDaoImpI;
import org.Vancl.entity.shoppingAddress;
@WebServlet(urlPatterns="/readAddressbianji.shtml")
public class ReadAddressbianjiServlet extends HttpServlet {
		@Override
		protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
			req.setCharacterEncoding("utf-8");
			resp.setContentType("text/html; charset=utf-8");
			String id=req.getParameter("bianjiid");
			ShoppingAddressDao shoppingAddressDao=new ShoppingAddressDaoImpI();
			shoppingAddress sa=shoppingAddressDao.getid(Integer.parseInt(id));
			PrintWriter out=resp.getWriter();
			out.print(sa.getSa_name());
			out.println(",");
			out.print(sa.getSa_phone());
			out.println(",");
			out.print(sa.getSa_postcode());
			out.println(",");
			out.print(sa.getSa_address());
			out.println(",");
			out.print(sa.getSa_id());
			
			

		}
		@Override
		protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
				this.doGet(req, resp);
		}
}
